<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
<div region="center" style="padding: 1px;">
<t:datagrid name="personalAccountInfoList" title="个人客户信息查询"  onLoadSuccess="onLoadSuccess" autoLoadData="false" actionUrl="judicialControll.do?personalAccountInfoQuery" sortName="acctno" fitColumns="true"
	idField="id" fit="true" queryMode="group"  showText="true">
	<%--   update-end--Author:tanghan  Date:20130713 for添加checkbox--%>
	<t:dgCol title="poc.account" field="acctno" query="true"  hidden="false" width="120"></t:dgCol>
	<t:dgCol title="rowkey" field="rowkey"  hidden="true" width="120"></t:dgCol>
	<t:dgCol title="户名" field="custcn"    width="80"></t:dgCol>
	<t:dgCol title="客户号"  field="custno"  hidden="true"  width="100"></t:dgCol>
	<t:dgCol title="子户号"  field="subsac"   width="120"></t:dgCol>
	<t:dgCol title="证件类型" field="certtp" width="150" dictionary="certtp" hidden="true"></t:dgCol>
	<t:dgCol title="poc.card.id" field="certno" width="150" query="true" hidden="true"></t:dgCol>
	<t:dgCol title="币种" field="crcycd" width="120"></t:dgCol>
	<t:dgCol title="账户余额" field="lastbl"   queryMode="group" width="80"></t:dgCol>
	<t:dgCol title="可用余额" field="avabl" width="80"></t:dgCol>
	<t:dgCol title="存期"  field="termcd" width="80"></t:dgCol>
    <t:dgCol title="开户日期" field="opendt" width="120"></t:dgCol>
	<t:dgCol title="销户日期" field="closdt"   hidden="false" width="120"></t:dgCol>
	<t:dgCol title="账户类型" sortable="true" field="spectp" dictionary="spectp"  width="80"></t:dgCol>
	<t:dgCol title="开户机构" field="brhnm" width="60" ></t:dgCol>
	<t:dgCol title="账户状态" field="acctst" dictionary="acctst"  hidden="true" width="60"></t:dgCol>
	<t:dgCol title="客户类型" field="eplytg" width="80" dictionary="eplytg"  hidden="true"></t:dgCol>
	
	<t:dgToolBar title="excelOutput" icon="icon-search" onclick="personalAccountInfoListExportXls();"></t:dgToolBar>

</t:datagrid></div>
</div>
<script type="text/javascript">
	function isNull(pa){
	  var resp='';
	  if(pa ==null || pa==''){
	    resp+=';';
	  }else{
	  	resp+=pa+ ';';
	  }
	   return resp;
	}
    function getParams(){
		var param 
        var custcn= $("input[name='custcn']").val();
	    var acctno= $("input[name='acctno']").val();
	    var certtp= $("select[name='certtp']").val();
	    var certno= $("input[name='certno']").val();
	    var acctst = $("select[name='acctst']").val();
	    var custno= $("input[name='custno']").val();
	    var eplytg= $("select[name='eplytg']").val();
	    
	    param = isNull(custno) + isNull(acctno) + isNull(certno) + isNull(acctst) + isNull(eplytg)  + isNull(certtp)
	                  + isNull(custcn);
        return param;	                  
	    
    }
    
   // var pageflag ="down";
    //var allflag=0;
    function onLoadSuccess(){
       var startkey = getrowkey(1);
       var endkey = getrowkey(0);
       $('#personalAccountInfoList').datagrid('options').queryParams={'startkey':startkey,'endkey':endkey,'param':getParams()};
       
    }
    function getrowkey(flag){
        var  rowkey;
    	var datas = $('#personalAccountInfoList').datagrid('getRows');
    	var le ;
    	if(flag==0){//下一页
    	   le = $('#personalAccountInfoList').datagrid('getData').rows[datas.length-1];
    	}else if(flag==1){//上一页
    	   le = $('#personalAccountInfoList').datagrid('getData').rows[0];
    	}else{
    	  le ='';
    	  return '';
    	}
    	if(null != le && le !=''){
	    	for(var i in le){
	    		if(i=='rowkey'){
	    			rowkey=le[i];
    				return rowkey;
	    		}
	    	}
    	}
    }
    function personalAccountInfoListsearch(){
    	var param = getParams();
    	$('#personalAccountInfoList').datagrid({
    	    url: 'judicialControll.do?personalAccountInfoQuery&param='+param+'&field=acctno,rowkey,custcn,custno,subsac,certtp,certno,crcycd,lastbl,avabl,termcd,opendt,closdt,spectp,brchno,acctst,eplytg,brhnm,'
    	});
    }
    function personalAccountInfoListExportXls(){
        var param = getParams();
    	JeecgExcelExport("judicialControll.do?personalAccountInfoDown&param="+param,"personalAccountInfoList");
    }
</script>